<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::middleware('auth:api')->get('/user', function (Request $request) {
    return $request->user();
   
});



//司机请假审批
Route::group([
   // 'middleware' => 'jwt.api.auth',
    'prefix' => 'chauffeur'
], function () {
    Route::any('index', 'ChauffeurController@index');//列表
    Route::any('show', 'ChauffeurController@show');//详情首show
    Route::any('save', 'ChauffeurController@save');//通过不通过
});
//司机费用审批
Route::group([
    // 'middleware' => 'jwt.api.auth',
    'prefix' => 'fee'
], function () {
    Route::any('index', 'FeeController@index');//列表
    Route::any('show', 'FeeController@show');//详情首show
    Route::any('save', 'FeeController@save');//通过不通过
    Route::any('rank', 'FeeController@rank');
    Route::any('see', 'FeeController@see');//费用类型展示
    Route::any('add', 'FeeController@add');//费用类型tianjai
    Route::any('del', 'FeeController@del');//费用类型tianjai
    Route::any('create', 'FeeController@create');//费用类型tianjai
});

//司机列表和详情
Route::group([
    // 'middleware' => 'jwt.api.auth',
    'prefix' => 'ChaufferurInfo'
], function () {
    Route::any('info', 'ChaufferurInfoController@info');
    Route::any('info_detail', 'ChaufferurInfoController@info_detail');
    Route::any('info_show', 'ChaufferurInfoController@info_show');
});

//审批流
Route::group([
   // 'middleware' => 'jwt.api.auth',
    'prefix' => 'Approval'
], function () {
    Route::any('index', 'ApprovalController@index');//  * 【审批流列表】
    Route::any('add', 'ApprovalController@add');//  * 【审批流添加页面】
    Route::post('addpost', 'ApprovalController@addpost');//  * 【审批流添加页面】
    Route::any('del', 'ApprovalController@del');//  * 【审批流删除】
    Route::any('save', 'ApprovalController@save');//  * 【审批流修改】
});
//司机培训表
Route::group([
    // 'middleware' => 'jwt.api.auth',
    'prefix' => 'train'
], function () {
    Route::any('index', 'TrainController@index');
    Route::any('add', 'TrainController@add');
    Route::any('show', 'TrainController@show');
    Route::any('save', 'TrainController@save');
    Route::any('del', 'TrainController@del');
    Route::any('create', 'TrainController@create');//添加表格展示公司车队名称和id
    Route::any('showadd', 'TrainController@showadd');//展示司机列表方法
});

//司机信誉
Route::group([
    // 'middleware' => 'jwt.api.auth',
    'prefix' => 'credibility'
], function () {
    Route::any('index', 'CredibilityController@index');
    Route::any('save', 'CredibilityController@save');
    Route::any('reset', 'CredibilityController@reset');

});

//司机处罚
Route::group([
    // 'middleware' => 'jwt.api.auth',
    'prefix' => 'disciplined'
], function () {
    Route::any('index', 'DisciplinedControllwer@index');
    Route::any('save', 'DisciplinedControllwer@save');
    Route::any('reset', 'DisciplinedControllwer@reset');
    Route::any('show', 'DisciplinedControllwer@show');
    Route::any('add', 'DisciplinedControllwer@add');
    Route::any('showadd', 'DisciplinedControllwer@showadd');
    Route::any('create', 'DisciplinedControllwer@create');
});

//首页接口
Route::group([
    // 'middleware' => 'jwt.api.auth',
    'prefix' => 'Home'
], function () {
    Route::any('index', 'HomeController@index');
    Route::any('read', 'HomeController@read');
    Route::any('unread', 'HomeController@unread');
    Route::any('store', 'HomeController@store');
    Route::any('unstore', 'HomeController@unstore');
    Route::any('show', 'HomeController@show');
    Route::any('edit', 'HomeController@edit');
});

 Route::any('order/servicelist', 'OrderController@servicelist'); 
 Route::any('order/orderlist', 'OrderController@orderlist'); 
 Route::any('order/orderDetail', 'OrderController@orderDetail'); 
  Route::any('order/delOrder', 'OrderController@delOrder'); 
 Route::any('order/changeHistory', 'OrderController@changeHistory'); 
 Route::any('order/test', 'OrderController@test'); 
 Route::any('order/countdis', 'OrderController@countdis'); 
 Route::any('order/driverList', 'OrderController@driverList'); 
 Route::any('order/changeDriver', 'OrderController@changeDriver'); 
 Route::any('order/Distributeleaflets', 'OrderController@Distributeleaflets'); 
 Route::any('order/changeTime', 'OrderController@changeTime'); 
 Route::any('order/driverP', 'OrderController@driverP'); 
 Route::any('order/selectConditionComS', 'OrderController@selectConditionComS'); 
 Route::any('order/selectConditionComD', 'OrderController@selectConditionComD'); 
 Route::any('order/selectConditionCom', 'OrderController@selectConditionCom'); 
 Route::any('order/selectCondition', 'OrderController@selectCondition'); 

 Route::any('order/selectCondition', 'OrderController@selectCondition'); 
 Route::any('message/text', 'MessageController@text'); 

 // 司机管理
Route::any('driver/driver', 'DriverController@driver');
Route::any('driver/driver_edit', 'DriverController@driver_edit');
Route::any('driver/del', 'DriverController@del');
Route::any('driver/repassword', 'DriverController@repassword');
Route::any('driver/dongjie', 'DriverController@dongjie');
Route::any('driver/jiechudongjie', 'DriverController@jiechudongjie');
Route::any('driver/carlist', 'DriverController@carlist');
Route::any('driver/bdcar', 'DriverController@bdcar');
Route::any('driver/dictionary', 'DriverController@dictionary');
Route::any('driver/edit', 'DriverController@edit');
Route::any('driver/add', 'DriverController@add');
Route::any('driver/driveritems', 'DriverController@driveritems');
Route::any('driver/driverorder', 'DriverController@driverorder');
Route::any('driver/chufa', 'DriverController@chufa');
Route::any('driver/chafaaddoption', 'DriverController@chafaaddoption');
Route::any('driver/chufaaddlist', 'DriverController@chufaaddlist');
Route::any('driver/chufainsert', 'DriverController@chufainsert');
Route::any('driver/chufadel', 'DriverController@chufadel');

// 公司/机构管理
Route::any('branch/branch', 'BranchController@branch'); // 公司(分支机构)列表信息数据
Route::any('branch/branch_edit', 'BranchController@branch_edit');   // 修改公司信息
Route::any('branch/edit', 'BranchController@edit');   // 修改公司信息页面赋值
Route::any('branch/del', 'BranchController@del');   // 删除公司 软删除
Route::any('branch/convoylist', 'BranchController@convoylist'); // 关联车队->车队列表
Route::any('branch/bdconvoy', 'BranchController@bdconvoy'); // 车队关联公司
Route::any('branch/add', 'BranchController@add');   // 添加机构
Route::any('branch/branchitem', 'BranchController@branchitem');     // 机构详情页面
Route::any('branch/itemconvoylist', 'BranchController@itemconvoylist');  // 详情页绑定车队列表
Route::any('branch/convoyjiechu', 'BranchController@convoyjiechu');  // 解除绑定的车队
// 消息管理
Route::any('message/message', 'MessageController@message'); //消息配置列表
Route::any('message/edit', 'MessageController@edit'); //消息配置修改页面赋值
Route::any('message/message_edit', 'MessageController@message_edit');  // 修改消息配置
Route::any('message/message_add', 'MessageController@message_add');  //添加消息配置
Route::any('message/del', 'MessageController@del'); //禁用/启用

// 车队信息数据
Route::any('convoy/convoy', 'ConvoyController@convoy'); //车队信息数据
Route::any('convoy/edit', 'ConvoyController@edit'); //修改车队信息页面赋值
Route::any('convoy/convoy_edit', 'ConvoyController@convoy_edit'); //修改车队信息
Route::any('convoy/del', 'ConvoyController@del'); //删除车队 软删除
Route::any('convoy/driverlist', 'ConvoyController@driverlist'); //关联司机->司机列表  设置队长->司机列表
Route::any('convoy/bdconvoy', 'ConvoyController@bdconvoy'); //司机关联车队
Route::any('convoy/duizhang', 'ConvoyController@duizhang'); //设置队长->设置队长
Route::any('convoy/add', 'ConvoyController@add'); //添加车队
Route::any('convoy/convoyitem', 'ConvoyController@convoyitem'); //车队详情页面
Route::any('convoy/itemdriverlist', 'ConvoyController@itemdriverlist'); //详情页绑定司机列表
Route::any('convoy/driverjiechu', 'ConvoyController@driverjiechu'); //接触绑定的司机

// 字典信息数据
Route::any('dictionary/dictionary', 'DictionaryController@dictionary'); //字典信息数据列表
Route::any('dictionary/edit', 'DictionaryController@edit'); //修改字典信息页面赋值
Route::any('dictionary/convoy_add', 'DictionaryController@convoy_add'); //增加字典信息
Route::any('dictionary/convoy_edit', 'DictionaryController@convoy_edit'); //修改字典信息
Route::any('dictionary/del', 'DictionaryController@del'); //修改字典信息



Route::any('user/login','UserController@login');//登录
Route::any('user/departlist','UserController@departList');//部门树状列表
Route::any('user/roleslist','UserController@rolesList');//角色列表树状显示
Route::any('user/loginout','UserController@loginOut');//退出登录
Route::any('user/updatepass','UserController@updatePass');//修改密码
Route::any('role/powerlist','RoleController@powerList');//权限树状列表
Route::any('car/brand','CarController@brand');//品牌、子品牌下拉框
Route::any('car/level','CarController@level');//级别下拉框
Route::any('car/series','CarController@series');//车系下拉框
Route::any('car/type','CarController@type');//车型下拉列表
Route::any('purchcar/purchbrand','PurchcarController@purchBrand');//已采购车辆品牌下拉列表
Route::any('purchcar/purchchild','PurchcarController@purchChild');//已采购车辆子品牌下拉列表
Route::any('purchcar/purchseries','PurchcarController@purchSeries');//已采购车系下拉列表
Route::any('purchcar/purchtype','PurchcarController@purchType');//已采购车型下拉列表
Route::any('purchcar/company','PurchcarController@company');//所属公司下拉列表
    Route::any('purchcar/area','PurchcarController@area');//地区下拉列表
Route::any('dictionary/dictionarylist','DictionaryController@dictionaryList');//字典信息
Route::any('cost/serverlist','CostController@serverList');//服务列表
Route::any('car/upload','CarController@upload');//上传

// Route::Group([

//     'middleware'=>['checkloginrbac']

// ],  function(){
    
    //部门管理
    Route::any('user/adddepart','UserController@addDepart');//部门添加
    Route::any('user/finddepart','UserController@findDepart');//部门列表
    Route::any('user/deletedepart','UserController@deleteDarpt');//删除部门
    Route::any('user/updatedepart','UserController@updateDepart');//修改部门

    //用户管理
    Route::any('user/adduser','UserController@addUser');//添加用户
    Route::any('user/finduser','UserController@findUser');//用户列表
    Route::any('user/deleteuser','UserController@deleteUser');//删除用户
    Route::any('user/updateuser','UserController@updateUser');//用户信息更新
    Route::any('user/updatestatus','UserController@updateStatus');//修改用户状态
    Route::any('user/setroles','UserController@setRoles');//为用户分配角色
    
    //角色管理
    Route::any('role/addrole','RoleController@addRole');//添加角色
    Route::any('role/findrole','RoleController@findRole');//角色列表
    Route::any('role/deleterole','RoleController@deleteRole');//删除角色
    Route::any('role/updaterole','RoleController@updateRole');//角色信息更新
    Route::any('role/setpower','RoleController@setPower');//为角色分配权限

    //权限管理
    Route::any('power/addpower','PowerController@addPower');//添加权限
    Route::any('power/findpower','PowerController@findPower');//权限列表
    Route::any('power/deletepower','PowerController@deletePower');//删除权限
    Route::any('power/updatepower','PowerController@updatePower');//更新权限新下
    Route::any('power/updatestatus','powerController@updateStatus');//修改权限状态

    //车品牌管理
    Route::any('car/addbrand','CarController@addBrand');//添加品牌
    Route::any('car/findbrand','CarController@findBrand');//品牌列表
    Route::any('car/deletebrand','CarController@deleteBrand');//批量删除品牌
    Route::any('car/deletechild','CarController@deleteChild');//删除子品牌
    Route::any('car/updatebrand','CarController@updateBrand');//修改品牌

    //车系管理
    Route::any('car/addseries','CarController@addSeries');//添加车系
    Route::any('car/findseries','CarController@findSeries');//车系列表
    Route::any('car/deleteseries','CarController@deleteSeries');//删除车系
    Route::any('car/updateseries','CarController@updateSeries');//修改车系

    //级别管理
    Route::any('car/addlevel','CarController@addLevel');//添加级别
    Route::any('car/findlevel','CarController@findLevel');//级别列表
    Route::any('car/setstatus','CarController@setStatus');//删除/冻结级别
    Route::any('car/updatelevel','CarController@updateLevel');//修改级别

    //车型管理
    Route::any('car/addtype','CarController@addType');//添加车型
    Route::any('car/findtype','CarController@findType');//车型列表
    Route::any('car/deletetype','CarController@deleteType');//车型删除，软删除/设置展示或不展示
    Route::any('car/updatetype','CarController@updateType');//修改级别

    //限号管理
    Route::any('purchcar/addnumber','PurchcarController@addNumber');//限号添加
    Route::any('purchcar/findnumber','PurchcarController@findNumber');//限号列表
    Route::any('purchcar/deletenumber','PurchcarController@deleteNumber');//删除限号
    Route::any('purchcar/updatenumber','PurchcarController@updateNumber');//修改限号

    //厂商管理
    Route::any('purchcar/addsupp','PurchcarController@addSupp');//厂商添加
    Route::any('purchcar/findsupp','PurchcarController@findSupp');//厂商列表
    Route::any('purchcar/deletesupp','PurchcarController@deleteSupp');//删除厂商
    Route::any('purchcar/updatesupp','PurchcarController@updateSupp');//修改厂商
    
    //采购管理
    Route::any('purchcar/addpurch','PurchcarController@addPurch');//采购添加
    Route::any('purchcar/findpurch','PurchcarController@findPurch');//厂商列表
    Route::any('purchcar/updatepurch','PurchcarController@updatePurch');//删除厂商

    //平台车辆管理
    Route::any('purchcar/addcar','PurchcarController@addCar');//平台车辆添加
    Route::any('purchcar/findcar','PurchcarController@findCar');//平台车辆列表
    Route::any('purchcar/deletecar','PurchcarController@deleteCar');//删除平台车辆
    Route::any('purchcar/updatecar','PurchcarController@updateCar');//修改平台车辆
    Route::any('purchcar/deleteinsura','PurchcarController@deleteInsura');//删除平台车辆保险


// });

//成本管理
Route::any('cost/addcost','CostController@addCost');//添加成本
Route::any('cost/citylist','CostController@cityList');//已关联城市列表
Route::any('cost/relationcity','CostController@relationCity');//关联城市
Route::any('cost/relationcar','CostController@relationCar');//关联车系
Route::any('cost/algor','CostController@relationAlgor');//发布算法  
Route::any('cost/findcost','CostController@findCost');//成本列表
Route::any('cost/deletecost','CostController@deleteCost');//删除成本
Route::any('cost/updatecost','CostController@updateCost');//修改成本
Route::any('cost/setstatus','CostController@setStatus');//冻结、启用成本
Route::any('cost/findhistory','CostController@findHistory');//查看历史算法

// 字典
Route::any('branch/zidianlist','BranchController@zidianlist');//查看字典数据
Route::any('branch/sheng','BranchController@sheng');//查看字典数据
Route::any('branch/shi','BranchController@shi');//查看字典数据
Route::any('branch/qu','BranchController@qu');//查看字典数据
